Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use tags for metrics #3226

Merged
merged 4 commits into from
Sep 17, 2020
Merged

use tags for metrics #3226

merged 4 commits into from
Sep 17, 2020

Conversation

vladak
Copy link
Member

@vladak vladak commented Sep 16, 2020

This changes metric handling in AuthorizationFramework to use tags. Looks like this:

$ curl -s -X GET http://localhost:8080/source/metrics/prometheus | grep ^auth
authorization_latency_seconds_max{outcome="negative",} 0.0
authorization_latency_seconds_max{outcome="positive",} 0.0
authorization_latency_seconds_count{outcome="negative",} 0.0
authorization_latency_seconds_sum{outcome="negative",} 0.0
authorization_latency_seconds_count{outcome="positive",} 83.0
authorization_latency_seconds_sum{outcome="positive",} 0.001039
authorization_sessions_invalidated_total 0.0
authorization_stack_reload_total 0.0
authorization_cache_total{what="misses",} 83.0
authorization_cache_total{what="hits",} 58.0

which allows for easier creation of all-in-one graphs just like they are available for some of the JVM metrics:

grafana-opengrok-auth

Had to use build pattern to avoid micrometer-metrics/micrometer#877

Also, I changed the metric names to use the dotted notation so they can be converted to native naming conventions used in the respective backend (https://micrometer.io/docs/concepts#_naming_meters).

@coveralls
Copy link

coveralls commented Sep 16, 2020

Pull Request Test Coverage Report for Build 5323

  • 26 of 30 (86.67%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 74.774%

Changes Missing Coverage Covered Lines Changed/Added Lines %
plugins/src/main/java/opengrok/auth/plugin/ldap/LdapFacade.java 3 7 42.86%
Totals Coverage Status
Change from base Build 5316: 0.005%
Covered Lines: 40508
Relevant Lines: 54174

💛 - Coveralls

@vladak
Copy link
Member Author

vladak commented Sep 16, 2020

Also added LDAP lookup timer.

@ahornace
Copy link
Contributor

Nice work.

@ahornace ahornace merged commit 4b8c49e into oracle:master Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants